//
//  ios_functions.mm
//  Prism
//
//  Created by Bas du Pre on 26-05-11.
//  Copyright 2011 UU. All rights reserved.
//

#include "ios_functions.h"

#include "Director.h"

Prism::Point native_correctPosition(Prism::Point position) {
    Prism::Size winSize = Prism::Director::instance()->winSize();
    position.y = winSize.height - position.y;
    return position;
}

Prism::PointF native_correctPositionF(Prism::PointF position) {
    Prism::Size winSize = Prism::Director::instance()->winSize();
    position.y = winSize.height - position.y;
    return position;
}

CGPoint native_correctPositionCG(CGPoint position) {
    Prism::Size winSize = Prism::Director::instance()->winSize();
    position.y = winSize.height - position.y;
    return position;
}

Prism::Point native_correctNormalizedPosition(Prism::Point position) {
    position.y = 1.0 - position.y;
    return position;
}

Prism::PointF native_correctNormalizedPositionF(Prism::PointF position) {
    position.y = 1.0 - position.y;
    return position;
}

CGRect native_prismRectToCGRect(Prism::Rect rect) {
    CGRect cgrect;
    cgrect.origin.x = rect.origin.x;
    cgrect.origin.y = rect.origin.y;
    cgrect.size.width = rect.size.width;
    cgrect.size.height = rect.size.height;
    return cgrect;
}